<%@ Page Language="C#" %>

<script runat="server">
    protected void Page_Load(object sender, System.EventArgs e) {
        localhost.Async ws = new localhost.Async();
        IAsyncResult myIar;
        
        myIar = ws.BeginHelloWorld(null, null);
        
        int x = 0;
        
        while (myIar.IsCompleted == false) {
            x += 1;
        }
        
        Label1.Text = "Wynik wywoania metody sieciowej: " + ws.EndHelloWorld(myIar) +
           "<br>Licznik czasu oczekiwania: " + x.ToString();
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Wywoanie asynchroniczne</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="Label1" Runat="server"></asp:Label>
    </div>
    </form>
</body>
</html>
